package cn.sc.summer.security.config;

import cn.sc.summer.security.provider.LoginAuthenticationProvider;
import cn.sc.summer.security.provider.AppLoginAuthenticationProvider;
import cn.sc.summer.security.provider.SmsCodeAuthenticationProvider;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.ProviderManager;

import java.util.Arrays;

/**
 * 类名：provider校验器配置类
 *
 * @author a-xin
 * @date 2024/6/29 13:42
 */
@Slf4j
@Configuration
public class ProviderConfig {

    @Bean
    public AuthenticationManager authenticationManager() {
        return new ProviderManager(Arrays.asList(
                new LoginAuthenticationProvider(),
                new SmsCodeAuthenticationProvider(),
                new AppLoginAuthenticationProvider()));
    }

}
